/* 
 * File:   FileThread.h
 * Author: Imre Tabur
 *
 */
#ifndef CLOUDY_STORAGE_FILETHREAD_H
#define	CLOUDY_STORAGE_FILETHREAD_H

#include <boost/thread.hpp>
#include "File.h"

namespace CloudyStorage {

    /**
     * File downloading thread.
     */
    class FileThread {
        boost::thread *workerThread;
        File *file;
    public:
        FileThread();
        virtual ~FileThread();
        static void worker(const FileThread& fileThread);
        File *getFile();
        void setFile(File *file);
        void start();
        void stop();
        void join();
        void push();
        void pull();
    private:
        void run() const;
    };
}
#endif	/* CLOUDY_STORAGE_FILETHREAD_H */
